﻿#region Usings
using BK.BL;
using BK.Entities;
#endregion

namespace BK.WebSite.Accounting.Autocomplete
{
	/// <summary>
	/// Summary description for GetCountries
	/// </summary>
	public class GetAccounts : BaseAutocompleteHandler<AccountEntity, Accounts>
	{
		#region Instance Methods
		protected override AutocompleteEntity[] DoConvertEntities(AccountEntity[] entities)
		{
			AutocompleteEntity[] result = new AutocompleteEntity[entities.Length];
			for (int i = 0; i < result.Length; i++)
			{
				result[i] = new AutocompleteEntity
				            	{
				            		Text = entities[i].Name,
				            		Value = entities[i].Id.ToString()
				            	};
			}
			return result;
		}
		#endregion
	}
}